package com.blb.proxy;

/**
 * 手机代理商店
 */
public class CellphoneShop implements CellphoneSales{

    //被代理对象的引用
    private CellphoneSales factory = null;

    //创建代理对象时传入被代理对象
    public CellphoneShop(CellphoneSales factory){
        this.factory = factory;
    }

    @Override
    public void sellCellphone(String brand) {
        //执行业务时，调用被代理对象的方法，同时进行功能扩展
        System.out.println(brand + "手机真好！功能很牛逼！");
        this.factory.sellCellphone(brand);
        System.out.println("我们提供售后服务，欢迎光临");
    }
}
